import {request} from "../request";
import {utils} from "../../common/utils";
//查询信息
export function carAll({brand,type,pageNum,pageSize}){
    return request({
        url:'/vehicle/query',
        method:'get',
        params:{
            brand,type,pageNum,pageSize
        }
    })
}
//新增信息
export function addCar({licensePlate, brand, worth, type, enabled, vehicleImg}){
    return request({
        url:"/vehicle/add",
        method:'post',
        data: {licensePlate, brand, worth, type, enabled, vehicleImg}
    })
}
//修改信息
export function updatevehicle(vehicle){
    return request({
        url:'/vehicle/update',
        method:'put',
        data:vehicle
    })
}
//删除信息
export function deletecar(ids){
    let stUrl = utils.joinArrayReqParam(ids,"ids")
    return request({
        url:'/vehicle/delete'+ stUrl,
        method:'delete'
    })
}
//车辆下拉选择信息
export function selectCarNmae(){
    return request({
        url:'/vehicle/enabledquery',
        method:'get',
        params:{}
    })
}
//车辆申请记录信息
export function shenqingdaipizhun({empName}){
    return request({
        url:'/process/vehicle-py/query',
        method:'get',
        params:{
            empName
        }
    })
}
//根据id修改车辆申请信息记录当前状态
export function updateStatus(vehiclePy){
    return request({
        url:"/process/vehicle-py/update",
        method:'put',
        data:vehiclePy
    })
}
//获取已通过审批的车辆信息
export function selectMyvheicle({empName}){
    return request({
        url:"/vehicleRecord/query",
        method:"get",
        params:{empName,}
    })
}
//新增同意领用记录信息
export function addVehicleRecord(vehicleRecord){
    return request({
        url:'/vehicleRecord/add',
        method:'post',
        data:vehicleRecord
    })
}
//获取当前领用时间领用时间
export function updateVehicleRecord(vehicleRecord){
    return request({
        url:"/vehicleRecord/update",
        method:'put',
        data:vehicleRecord
    })
}